package com.liaoyifan.core.converter;

import com.liaoyifan.core.properties.RedisProperties;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;
import org.redisson.config.ClusterServersConfig;
import org.redisson.config.SingleServerConfig;

@Mapper(config = ConverterConfig.class)
public interface RedisConverter {

    RedisConverter INSTANCE = Mappers.getMapper(RedisConverter.class);

    void toClusterConfig(RedisProperties source, @MappingTarget ClusterServersConfig target);

    void toSingleServerConfig(RedisProperties source, @MappingTarget SingleServerConfig target);
}
